package com.wn.cloud.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @FileName: ConfigController
 * @Description: TODO
 * @Author: MaWenHao
 * @Created: 2020/3/24 - 22:22
 * @Version: V1.0
 * @Company: 东方微银科技（北京）有限公司
 */
@RefreshScope
@RestController
@RequestMapping("/config")
public class ConfigController {

    @Value("${server.port}")
    private String port;

    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/info")
    public String findConfigInfo() {
        return "port: " + port + "\n\tconfigInfo: " + configInfo;
    }
}
